package com.acwing.partition9;

import java.io.*;

/**
 * @author `RKC`
 * @date 2021/12/8 9:10
 */
public class AC889满足条件的01序列 {

    private static final int MOD = 1000000007;

    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
        String[] s = reader.readLine().split(" ");
        int n = Integer.parseInt(s[0]);
        writer.write(catalanNumber(n) + "\n");
        writer.flush();
    }

    private static long catalanNumber(int n) {
        //直接使用卡特兰数的公式
        long answer = 1;
        int a = 2 * n, b = n;
        for (int i = 1, j = a; i <= b; i++, j--) {
            //如果mod是质数可以直接使用快速幂求逆元，如果不是，需要使用扩展欧几里得算法计算逆元
            answer = answer * j % MOD * quickPow(i, MOD - 2, MOD) % MOD;
        }
        answer = answer * quickPow(1 + n, MOD - 2, MOD) % MOD;
        return answer;
    }

    private static long quickPow(int a, int k, int p) {
        long res = 1, t = a;
        while (k != 0) {
            if ((k & 1) == 1) res = res * t % p;
            k >>= 1;
            t = t * t % p;
        }
        return res;
    }
}
